home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12093 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!dstrip.demon.co.uk
  2. From: Steve Rencontre <Steve@dstrip.demon.co.uk>
  3. Newsgroups: comp.dsp,comp.lang.c
  4. Subject: Re: C code .vs. Assembly code for Microcontrollers/DSPs ?
  5. Date: Thu, 28 Mar 1996 16:59:26 
  6. Organization: Datastrip Limited
  7. Message-ID: <436922997wnr@dstrip.demon.co.uk>
  8. References: <620174950wnr@dstrip.demon.co.uk> <4j9lfh$o2l@narses.hrz.tu-chemnitz.de>
  9. Reply-To: Steve@dstrip.demon.co.uk
  10. X-NNTP-Posting-Host: dstrip.demon.co.uk
  11. X-Newsreader: Newswin Alpha 0.9
  12. X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!dstrip.demon.co.uk
  13.  
  14. In article: <4j9lfh$o2l@narses.hrz.tu-chemnitz.de>  
  15. hfst@hrz.tu-chemnitz.de (Hans Steffani) writes:
  16. > Steve Rencontre <Steve@dstrip.demon.co.uk> writes:
  17. > >Oh yes it can!
  18. > >    ...    
  19. > >    int var1, var2;
  20. > >    int *var1p = &var1;
  21. > >    var1p[-1] = 0;
  22. > >    ...
  23. > Post this to comp.lang.c[.moderated] and you will be told that this
  24. > leads to undefined behavior and something like that. 
  25.  
  26. Well my newsreader doesn't know how to post to moderated groups, and I'm 
  27. too lazy to do it by hand :-), but anyway...
  28.  
  29. It may be undefined by the *language*, but then so is the size of an 
  30. int! However, this very behaviour is relied on by stdargs/varargs in 
  31. order to make variable parameter lists possible. Yes, it's 
  32. implementation-dependent -- but that doesn't mean it results in 
  33. unpredictable or unreliable behaviour within that implementation.
  34.  
  35. -----------------------------------------------------------------------
  36. Steve Rencontre               |  steve@dstrip.demon.co.uk (business) 
  37. If it works, it's obsolete.   |  steveren@cix.compulink.co.uk (private)
  38. -----------------------------------------------------------------------
  39.  
  40.